package main

import (
	"fmt"
	"strconv"
)

func main() {
	//a := int(3.0)
	//fmt.Println(a)
	//var a int64 = 56
	//var b int64 = int64(a)
	//println(b)
	//	int转字符串 itoa
	//fmt.Printf("%T\n", strconv.Itoa(int(a)))
	//data, _ := strconv.Atoi("12")
	//fmt.Println(data)
	//b, _ := strconv.ParseBool("True")
	//fmt.Println(b)
	//f, _ := strconv.ParseFloat("3.1415", 32)
	//fmt.Printf("%T\n", f)
	//i, _ := strconv.ParseInt("12", 10, 64)
	//fmt.Printf("%T %d\n", i, i)
	//	其他类型转字符串
	//s := strconv.FormatBool(true)
	//fmt.Println(s)

	var (
		data int
		err  error
	)
	if data, err = strconv.Atoi("12"); err != nil {
		fmt.Println("转换出错")
	}
	fmt.Println(data)

}
